export default (url) => {
  const getPage = (req) =>
    window.$axios({
      url: `${url}/page`,
      method: "get",
      params: req,
      meta: {
        hasProjectId: true,
      },
    });

  const remove = (categoryId, keepTime) =>
    window.$axios({
      url: `${url}/${categoryId}/${keepTime}`,
      method: "delete",
      meta: {
        hasProjectId: true,
      },
    });

  const visit = (data) =>
    window.$axios({
      url: `${url}`,
      method: "post",
      data,
      meta: {
        hasProjectId: true,
      },
    });

  return {
    getPage,
    remove,
    visit,
  };
};
